package cn.newgrand.netcall.ui.questionRecord;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import org.jivesoftware.spark.util.ResourceUtils;

public class QuestionDescriptionPanel extends JPanel{
	
	private static final long serialVersionUID = 1L;
	private JLabel productLabel;
	private JComboBox productField;
	private JLabel versionLabel;
	private JTextField versionField;
	private JLabel applyServerLabel;
	private JTextField applyServerField;
	private JLabel databaseServerLabel;
	private JTextField databaseServerField;
	private JLabel databaseTypeLabel;
	private JTextField databaseTypeField;
	private JLabel databaseVsersionLabel;
	private JTextField databaseVserionField;
	private JLabel questionDescriptionLabel;
	private JTextArea questionDescriptionArea;
	private JLabel primeReasonLabel;
	private JTextArea primeReasonArea;
	
	public QuestionDescriptionPanel(){
		setLayout(new GridBagLayout());
		String[] product = {"i6","A3","i6p","GE","netcall"};
		productLabel = new JLabel();
		productField = new JComboBox();
		for(int i = 0; i < product.length; i++){
			productField.addItem(product[i]);
		}
		ResourceUtils.resLabel(productLabel, "产品:");
		add(productLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(productField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        versionLabel = new JLabel();
        versionField = new JTextField(4);
		ResourceUtils.resLabel(versionLabel, versionField, "版本:");
		add(versionLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(versionField, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        applyServerLabel = new JLabel();
        applyServerField = new JTextField(4);
		ResourceUtils.resLabel(applyServerLabel, applyServerField, "应用服务器:");
		add(applyServerLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(applyServerField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        databaseServerLabel = new JLabel();
        databaseServerField = new JTextField(4);
		ResourceUtils.resLabel(databaseServerLabel, databaseServerField, "数据库服务器:");
		add(databaseServerLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(databaseServerField, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        databaseTypeLabel = new JLabel();
        databaseTypeField = new JTextField(4);
		ResourceUtils.resLabel(databaseTypeLabel, databaseTypeField, "数据库类型:");
		add(databaseTypeLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(databaseTypeField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        databaseVsersionLabel = new JLabel();
        databaseVserionField = new JTextField(4);
		ResourceUtils.resLabel(databaseVsersionLabel, databaseVserionField, "数据库版本:");
		add(databaseVsersionLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(databaseVserionField, new GridBagConstraints(3, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        questionDescriptionLabel = new JLabel();
        questionDescriptionArea = new JTextArea(5,5);
        JScrollPane questionDescripScrollPane = new JScrollPane(questionDescriptionArea);
		ResourceUtils.resLabel(questionDescriptionLabel, questionDescriptionArea, "问题描述:");
		add(questionDescriptionLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(questionDescripScrollPane, new GridBagConstraints(0, 4, 4, 2, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        
        primeReasonLabel = new JLabel();
        primeReasonArea = new JTextArea(5,5);
        JScrollPane primeReasonScrollPane = new JScrollPane(primeReasonArea);
		ResourceUtils.resLabel(primeReasonLabel, primeReasonArea, "初步结论:");
		add(primeReasonLabel, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(primeReasonScrollPane, new GridBagConstraints(0, 8, 4, 2, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
	}


	public JComboBox getProductField() {
		return productField;
	}


	public void setProductField(JComboBox productField) {
		this.productField = productField;
	}


	public JLabel getVersionLabel() {
		return versionLabel;
	}

	public void setVersionLabel(JLabel versionLabel) {
		this.versionLabel = versionLabel;
	}

	public JTextField getVersionField() {
		return versionField;
	}

	public void setVersionField(JTextField versionField) {
		this.versionField = versionField;
	}

	public JTextField getApplyServerField() {
		return applyServerField;
	}

	public void setApplyServerField(JTextField applyServerField) {
		this.applyServerField = applyServerField;
	}

	public JTextField getDatabaseServerField() {
		return databaseServerField;
	}

	public void setDatabaseServerField(JTextField databaseServerField) {
		this.databaseServerField = databaseServerField;
	}

	public JTextField getDatabaseTypeField() {
		return databaseTypeField;
	}

	public void setDatabaseTypeField(JTextField databaseTypeField) {
		this.databaseTypeField = databaseTypeField;
	}

	public JTextField getDatabaseVserionField() {
		return databaseVserionField;
	}

	public void setDatabaseVserionField(JTextField databaseVserionField) {
		this.databaseVserionField = databaseVserionField;
	}

	public JTextArea getQuestionDescriptionArea() {
		return questionDescriptionArea;
	}

	public void setQuestionDescriptionArea(JTextArea questionDescriptionArea) {
		this.questionDescriptionArea = questionDescriptionArea;
	}

	public JTextArea getPrimeReasonArea() {
		return primeReasonArea;
	}

	public void setPrimeReasonArea(JTextArea primeReasonArea) {
		this.primeReasonArea = primeReasonArea;
	}

}
